/**
 * 通过场所id获取appId
 * @param {String} pId
 * @return {Promise<Axios<T>>}
 */
export function login(data) {
  var url = '/gateway/sys/api/toLogin';
  return uni.sniper.post(url, data);
}

/**
 * 通过场所id获取appId
 * @param {String} pId
 * @return {Promise<Axios<T>>}
 */
export function studentInfo(data) {
  var url = '/school/api/zy/user/student/findAllStudent';
  return uni.sniper.post(url, data);
}

/**
 * 通过场所id获取appId
 * @param {String} pId
 * @return {Promise<Axios<T>>}
 */
export function getUserInfo(data) {
  var url = '/system/api/sys/user/getUserInfo';
  return uni.sniper.get(url, data);
}

/**
 * code登录
 * @param {Object} form
 * @param {String} form.code
 * @param {String} form.placeId
 * @return {Promise<Axios<T>>}
 */
export function userByWxCode({ code, placeId }) {
  console.log(code, placeId);
  return uni.sniper.post('/gateway/app/loginByOfficialAccounts', { code, placeId: parseInt(placeId) });
}
